
var WEIBO = WEIBO || new Object();

WEIBO.Configuration = {};

WEIBO.Configuration.API = {};

WEIBO.Configuration.API.HOST = "http://api.t.sina.com.cn/";

WEIBO.Configuration.API.FORMAT = "json";

WEIBO.Configuration.API.DATATYPE = "json";

WEIBO.Configuration.API.APPKEY = "2550823860";

WEIBO.Configuration.API.TIMELINE = {
	"public_timeline": {
		"resource":"statuses/public_timeline", 
		"keyname":"appkey",
		"method":"get",
		"auth":false,
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadStatuses"
	}, //获取最新更新的公共微博消息
	"friends_timeline": {
		"resource":"statuses/friends_timeline", 
		"keyname":"source", 
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["since_id","max_id","count","page"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadStatuses"
	}, // 获取当前用户所关注用户的最新微博信息 (别名: statuses/home_timeline)
	"user_timeline":{
		"resource":"statuses/user_timeline", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["id", "user_id", "screen_name", "since_id", "max_id", "count", "page"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadStatuses"
	}, // 获取用户发布的微博信息列表
	"mentions" : {
		"resource":"statuses/mentions", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["since_id", "max_id", "count", "page"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadStatuses"
	}, //获取@当前用户的微博列表
	"comments_timeline" : {
		"resource":"statuses/comments_timeline", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["since_id", "max_id", "count", "page"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadComments"
	} , //获取当前用户发送及收到的评论列表
	"comments_by_me":{
		"resource":"statuses/comments_by_me", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["since_id", "max_id", "count", "page"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadComments"
	}, //获取当前用户发出的评论
	"comments":{
		"resource":"statuses/comments", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["id"],
			"option":["count", "page"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoadComments"
	}, // 获取指定微博的评论列表
	"counts":{
		"resource":"statuses/counts", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["ids"]
		},
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoad"
	}, // 批量获取一组微博的评论数及转发数
	"unread":{
		"resource":"statuses/unread", 
		"keyname":"source",
		"method":"get",
		"auth":true,
		"returnFunction" : "jWEIBO.Connection.response.onJsonPLoad"
	} // 获取当前用户未读消息
};

WEIBO.Configuration.API.ACCESS = {
	"show": {
		"resource":"statuses/show",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["id"]
		}
	}, //根据ID获取单条微博信息内容
	"user_status_id":{
		"resource":"$userid$/status/$id$",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["id", "userid"]
		}
	}, // 根据微博ID和用户ID跳转到单条微博页面
	"update":{
		"resource":"statuses/update",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["status"],
			"option":["in_reply_to_status_id", "lat","long"]
		}
	}, // 发布一条微博信息
	"upload" : {
		"resource":"statuses/upload",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["status","pic"],
			"option":["lat","long"]
		}
	}, //上传图片并发布一条微博信息
	"destroy" : {
		"resource":"statuses/destroy/$id$",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["id"]
		}
	} , //删除一条微博信息
	"repost":{
		"resource":"statuses/repost",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["id"],
			"option":["status"]
		}
	}, //转发一条微博信息（可加评论）
	"comment":{
		"resource":"statuses/comment",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["id", "comment"],
			"option":["cid"]
		}
	}, // 对一条微博信息进行评论
	"comment_destroy":{
		"resource":"statuses/comment_destroy/$id$",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["id"]
		}
	}, // 删除当前用户的微博评论信息
	"reply":{
		"resource":"statuses/reply",
		"keyname":"source",
		"method":"post",
		"auth":true,
		"parameter":{
			"require":["id", "cid", "comment"]
		}
	}// 回复微博评论信息
};

WEIBO.Configuration.API.USER = {
	"show":{
		"resource":["users/show/$id$","users/show"],
		"resource_type":"option",
		"keyname":"source",
		"method":"get",
		"auth":false,
		"parameter":{
			"option":["id", "user_id", "screen_name"]
		}
	},
	"friends":{
		"resource":["statuses/friends/$id$","statuses/friends"],
		"resource_type":"option",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["id", "user_id", "screen_name","cursor"]
		}
	},
	"followers":{
		"resource":["statuses/followers/$id$","statuses/followers"],
		"resource_type":"option",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["id", "user_id", "screen_name", "cursor", "count"]
		}
	}
};

WEIBO.Configuration.API.DIRECTMESSAGE = {
	"direct_messages":{
		"resource":"direct_messages",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["since_id", "max_id", "count", "page"]
		}
	},
	"sent":{
		"resource":"direct_messages/sent",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"option":["since_id", "max_id", "count", "page"]
		}
	},
	"new":{
		"resource":"direct_messages/new",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["id", "text"],
			"option":["screen_name", "user_id"]
		}
	},
	"destroy":{
		"resource":"direct_messages/destroy/%id%",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["id"]
		}
	}
};

WEIBO.Configuration.API.FRIENDSHIP = {
	"create":{
		"resource":["friendships/create/$id$","friendships/create"],
		"resource_type":"option",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["screen_name","id", "user_id"],
			"option":["follow"]
		}
	}, 
	"destroy":{
		"resource":["friendships/destroy/$id$","friendships/destroy"],
		"resource_type":"option",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["screen_name","id", "user_id"],
			"option":["follow"]
		}
	},
	"exists":{
		"resource":"friendships/exists",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["user_a","user_b"]
		}
	}
	/*"show":{
		"resource":"friendships/show",
		"keyname":"source",
		"method":"get",
		"auth":true,
		"parameter":{
			"require":["target_id","target_screen_name"],
			"option":["source_id", "source_screen_name"]
		}
	}*/
};

WEIBO.Configuration.API.SOCIALGRAPH = {
	"friends":{
		"resource":"friends/ids/$id$",
		"keyname":"source",
		"method":"get",
		"auth":false,
		"parameter":{
			"require":["id"],
			"option":["user_id","screen_name","cursor","count"]
		}
	},
	"followers":{
		"resource":"friends/followers/$id$",
		"keyname":"source",
		"method":"get",
		"auth":false,
		"parameter":{
			"require":["id"],
			"option":["user_id","screen_name","cursor","count"]
		}
	}
};

WEIBO.Configuration.API.ACCOUNT = {
	"verify_credentials":{"resource":"account/verify_credentials"},
	"rate_limit_status":{"resource":"account/rate_limit_status"},
	"end_session": {"resource":"account/end_session"},
	"update_profile_image":{"resource":"account/update_profile_image"},
	"update_profile":{"resource":"account/update_profile"},
	"register":{"resource":"account/register"},
	"activate":{"resource":"Account/activate"}
};

WEIBO.Configuration.API.FAVORITES = {
	"favorites":{"resource":"favorites"},
	"create":{"resource":"favorites/create"},
	"destroy":{"resource":"favorites/destroy/0000"}
};